#ifndef __M_MESSAGE_H__
#define __M_MESSAGE_H__
// 定义日志消息类，进行日志中间信息的存储
#include "util.hpp"
#include "level.hpp"
#include <thread>
#include <memory>

namespace wrtlog
{
  struct LogMsg
  {
    using ptr = std::shared_ptr<LogMsg>;
    time_t _ctime; // 日志的时间戳
    LogLevel::value _level;
    const std::string _file;
    size_t _line;         // 行号
    std::thread::id _tid; // 线程 到时候直接构造
    std::string _logger;  // 日志器名称
    std::string _payload; // 有效主体
    std::string _name;
    LogMsg(std::string &name, std::string file, size_t line, std::string &&payload,
           LogLevel::value level) : _name(name), _file(file), _payload(std::move(payload)), _level(level),
                                    _line(line), _ctime(util::Date
                                    ::now()), _tid(std::this_thread::get_id())
    {
      // std::cout << "构造msg\n";
    }
  };
}

#endif